package models;

import java.util.List;
import javax.persistence.*;
import org.hibernate.annotations.NotFound;
import play.db.jpa.GenericModel;

@Entity
@Table(name="rel")
public class Release extends GenericModel {
	
	@Id
	public int id;
	
	public String name;
	
	@ManyToOne
	@JoinColumn(name="artist_credit")
	public Artist artist;
	
	@ManyToMany
	@JoinTable(name = "medium",
	joinColumns = {
		@JoinColumn(name = "rel")
	},
	inverseJoinColumns = {
		@JoinColumn(name = "tracklist")
	})
	public List<TrackList> trackLists;

	@OneToMany(cascade= CascadeType.ALL)
	public List<ReleaseImg> images;
}
